package com.gavel.parser;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AttrTable {

    private List<String> headers = new ArrayList<>();

    private List< Map<String, String>> datas = new ArrayList<>();

    public List<String> getHeaders() {
        return headers;
    }

    public void setHeaders(List<String> headers) {
        this.headers = headers;
    }

    public List<Map<String, String>> getDatas() {
        return datas;
    }

    public void setDatas(List<Map<String, String>> datas) {
        this.datas = datas;
    }

    public void put(int index, String name, String value) {

        while ( datas.size() < index+1 ) {
            datas.add(new HashMap<>());
        }

        datas.get(index).put(name, value);


    }
}
